/*
 * ============================================================================
 *
 *       Filename:  ceshi.c
 *
 *    Description:  
 *
 *        Version:  1.0
 *        Created:  2013年06月27日 16时58分06秒
 *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  jianxi sun (jianxi), ycsunjane@gmail.com
 *   Organization:  
 *
 * ============================================================================
 */
#include <stdio.h>
#include <stdint.h>

#define max(a,b) ((a)>(b)?(a):(b))
#define max_safe(a,b) ({typeof (a) _a = (a);typeof(b) _b = (b);_a > _b?_a:_b;})                       

int main()
{
	int c=1,d=1;
	printf("max:%d\nc:%d,d:%d\n",max(c++,d++),c,d);
	c = d =1;
	printf("max:%d\nc:%d,d:%d\n",max(c+d,d+c),c,d);
	c = d =1;
	printf("max_safe:%d\nc:%d,d:%d\n",max_safe(c++,d++),c,d);
}
